// components/navBar.js

const app = getApp()

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title:{
      type: String,
      value: ""
    },
    back: {
      type: Boolean,
      value: false
    },
    bottomHeight: {
      type: Number,
      value: 20
    },
  },
  
  attached: function(){
    var that = this;
    that.setNavSize();
    // that.setStyle();
  },
  /**
   * 组件的初始数据
   */
  data:{
    // status: 0,
    // navHeight:0
  },
  lifetimes:{
    ready(){
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    goback(){
      wx.navigateBack({
        delta: 1,
      })
    },
    // 通过获取系统信息计算导航栏高度
    setNavSize: function() {
      var that = this
          , sysinfo = wx.getSystemInfoSync()
          , statusHeight = sysinfo.statusBarHeight
          , isiOS = sysinfo.system.indexOf('iOS') > -1
          , navHeight;
      if (!isiOS) {
          navHeight = 48;
      } else {
          navHeight = 44;
      }
      that.setData({
          status: statusHeight,
          navHeight: navHeight
      })
    },
  },


})
